<?php require_once("auth.php"); ?>
<?php

include("config.php");
 if(isset($_REQUEST['shipperid']))
{

$id=$_REQUEST['shipperid'];
$query="delete from shippers where ShipperID=$id";
	if(mysql_query($query))
	{
	header('location:displayshippers.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['categoryid']))
{
$id=$_REQUEST['categoryid'];
$query="delete from categorys where catid=$id";
	if(mysql_query($query))
	{
	header('location:displaycategory.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['productid']))
{
$id=$_REQUEST['productid'];
$query="delete from products where serial=$id";
	if(mysql_query($query))
	{
	header('location:displayproducts.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['supplierid']))
{
$id=$_REQUEST['supplierid'];
$query="delete from suppliers where SupplierID=$id";
	if(mysql_query($query))
	{
	header('location:displaysuppliers.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['customerid']))
{
$id=$_REQUEST['customerid'];
$query="delete from customers where serial=$id";
	if(mysql_query($query))
	{
	header('location:displaycustomers.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['paymentid']))
{
$id=$_REQUEST['paymentid'];
$query="delete from payment where PaymentID=$id";
	if(mysql_query($query))
	{
	header('location:displaypayments.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}
else if(isset($_REQUEST['orderdetailsid']))
{
$id=$_REQUEST['orderdetailsid'];
$query="delete from orderdetails where OrderDetailID=$id";
	if(mysql_query($query))
	{
	header('location:displayorderdeatils.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}else if(isset($_REQUEST['orderid']))
{
$id=$_REQUEST['orderid'];
$query="delete from orders where OrderID=$id";
	if(mysql_query($query))
	{
	header('location:displayorders.php?deleted=deleted'); 
	}
	else
	{
	echo mysql_error();
	}
}

else
{echo mysql_error();

}
?>